package com.software.chemistry.controller;

import com.software.chemistry.service.ModelMineService;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.Enumeration;
import java.util.Map;
import java.util.Set;

@RestController
@RequestMapping("/unity")
public class UnityController {

    @Autowired
    private ModelMineService modelMineService;

    @PostMapping("/test")
    public String test(HttpServletRequest request) throws IOException {

        String file = request.getParameter("file");
        modelMineService.saveModelMine(file);

        return "保存成功";
    }

}
